define(["jquery","bbcare"],function($,$bb){
	var servers = {};
	var URL = $bb.baseUrl("followapp");

	/**
	 * 查询社区
	 */
	servers.ajaxAddress = function(callback){
		$bb.ajax({
			url: URL + "ctrl/ptmanage/qryAddress",
			success: function(data){
				if(data.success){
					callback(data.data);
				}else{
					$bb.toastShow(data.msg ? data.msg : "查询社区出错！");
				}	
			}
		});
	}

	/**
	 * 查询健康状况
	 */
	servers.ajaxHealthy = function(callback){
		$bb.ajax({
			url: URL + "ctrl/ptmanage/qryHealthy",
			success: function(data){
				if(data.success){
					callback(data.data);
				}else{
					$bb.toastShow(data.msg ? data.msg : "查询健康状况出错！");
				}	
			}
		});
	}

	/**
	 * 查询录入者
	 */
	servers.ajaxCreatAuthor = function(callback){
		$bb.ajax({
			url: URL + "ctrl/ptmanage/qryCreatAuthor",
			success: function(data){
				if(data.success){
					callback(data.data);
				}else{
					$bb.toastShow(data.msg ? data.msg : "查询录入者出错！");
				}	
			}
		});
	}

	/**
	 * 查询路径节点任务
	 */
	servers.ajaxTaskName = function(params,callback){
		$bb.ajax({
			url: URL + "ctrl/ptmanage/qryTaskName",
			data:JSON.stringify({
				data : params
			}),
			success: function(data){
				if(data.success){
					callback(data.data);
				}else{
					$bb.toastShow(data.msg ? data.msg : "查询路径节点任务出错！");
				}	
			}
		});
	}

	/**
	 * 查询评估量表问卷 
	 */
	servers.ajaxPostion = function(params,callback){
		$bb.ajax({
			url: URL + "service/evaluation/getPostion",
			data:JSON.stringify({
				data : {
					"evaluationType":params.evaluationType,
					"queueUserId":params.userId
				}
			}),
			success: function(data){
				if(data.success){
					callback(data.data,params);
				}else{
					$bb.toastShow(data.msg ? data.msg : "查询评估量表问卷出错！");
				}	
			}
		});
	}

	/**
	 * 查询用户信息
	 */
	servers.ajaxUserMassage = function(params,callback){
		$bb.ajax({
			url: URL + "service/evaluation/queryUserMassage",
			data:JSON.stringify({
				data : {
					"channelType":"2",
					"queueUserId":params.userId,
				}
			}),
			success: function(data){
				if(data.success){
					callback(data.data);
				}else{
					$bb.toastShow(data.msg ? data.msg : "查询用户信息出错！");
				}	
			}
		});
	}

	return servers;
});